class Product{
    constructor(name){
        this.name = name
    }
    init(){
        console.log("product init")
    }
    fun1(){

    }
    fun2(){

    }
}
class Creator{
    create(name){
        return new Product(name)
    }
}
let creator = function(name){
    return new Product(name)
}

// let creator = new Creator()
// let p1 = creator.create("p1")
// p1.init()
// p1.fun1()

export default{
    creator,    //函数方式允许调用
    Creator     //类名方式允许调用

}